Conditions | 1 |
Paths | 2 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict' |
||
20 | module.exports = function (containerToken, path, event) { |
||
21 | Module.getManifest(function (manifest) { |
||
22 | var options = manifest.getDevOption('autoreload') |
||
23 | if (!options || !('paths' in options)) { |
||
24 | return |
||
25 | } |
||
26 | if (typeof options.paths === 'string') { |
||
27 | options.paths = [options.paths] |
||
28 | } |
||
29 | |||
30 | var matched = false |
||
31 | for (var i in options.paths) { |
||
32 | if (!options.paths.hasOwnProperty(i)) { |
||
33 | continue |
||
34 | } |
||
35 | if (minimatch(path, options.paths[i])) { |
||
36 | matched = true |
||
37 | break |
||
38 | } |
||
39 | } |
||
40 | |||
41 | if (!matched) { |
||
42 | return |
||
43 | } |
||
44 | |||
45 | reload(containerToken, path, event) |
||
46 | }) |
||
47 | } |
||
48 |